home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 1.0 beta / flock-1.0RC3.en-US.win32.exe / flock / components / flockPhotoUpload.js < prev    next >
Text File  |  2007-10-18  |  3KB  |  105 lines

  1. //
  2. // BEGIN FLOCK GPL
  3. // 
  4. // Copyright Flock Inc. 2005-2007
  5. // http://flock.com
  6. // 
  7. // This file may be used under the terms of of the
  8. // GNU General Public License Version 2 or later (the "GPL"),
  9. // http://www.gnu.org/licenses/gpl.html
  10. // 
  11. // Software distributed under the License is distributed on an "AS IS" basis,
  12. // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. // for the specific language governing rights and limitations under the
  14. // License.
  15. // 
  16. // END FLOCK GPL
  17. //
  18.  
  19. const FLOCK_PHOTO_UPLOAD_CID = Components.ID('{f0189282-1c0c-46a5-a099-e11d5b1ef512}');
  20. const FLOCK_PHOTO_UPLOAD_CONTRACTID = '@flock.com/photo-upload;1';
  21. const FLOCK_PHOTO_UPLOAD_IID = Components.interfaces.flockIPhotoUpload;
  22.  
  23.  
  24. function flockPhotoUpload() {
  25. }
  26.  
  27. flockPhotoUpload.prototype= {
  28.     id: '',
  29.     originalFileSpec: '',
  30.     originalFilePath: '',
  31.     workingFilePath: '',
  32.     previewFileSpec: '',
  33.     previewFilePath: '',
  34.     thumbFileSpec: '',
  35.     thumbFilePath: '',
  36.  
  37.     title: '',
  38.     tags: '',
  39.     notes: '',
  40.     description: '',
  41.     privacy_use_batch: 'true',
  42.     is_public: '',
  43.     is_friend: '',
  44.     is_family: '',
  45.     album: '',
  46.     state: '',
  47.     /*
  48.      * states:
  49.      *         (blank)
  50.      *         uploading
  51.      *         pending
  52.      */
  53.     rotation: '',
  54.     crop: '',
  55.  
  56.     QueryInterface: function(iid) {
  57.         if (!iid.equals(Components.interfaces.nsISupports) &&
  58.             !iid.equals(FLOCK_PHOTO_UPLOAD_IID))
  59.             throw Components.results.NS_ERROR_NO_INTERFACE;
  60.         return this;
  61.     }
  62. };
  63.  
  64.  
  65. var flockPhotoUploadModule = {
  66.     registerSelf: function(compMgr, fileSpec, location, type) {
  67.         compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  68.         compMgr.registerFactoryLocation(FLOCK_PHOTO_UPLOAD_CID, 
  69.                                         "flockPhotoUpload JS component", 
  70.                                         FLOCK_PHOTO_UPLOAD_CONTRACTID, 
  71.                                         fileSpec, 
  72.                                         location,
  73.                                         type);
  74.     },
  75.  
  76.     getClassObject: function(compMgr, cid, iid) {
  77.         if (!cid.equals(FLOCK_PHOTO_UPLOAD_CID))
  78.             throw Components.results.NS_ERROR_NO_INTERFACE;
  79.  
  80.         if (!iid.equals(Components.interfaces.nsIFactory))
  81.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  82.  
  83.         return flockPhotoUploadFactory;
  84.     },
  85.  
  86.     canUnload: function(compMgr) { return true; }
  87. };
  88.  
  89. var flockPhotoUploadFactory = {
  90.     createInstance: function(outer, iid) {
  91.         if (outer != null)
  92.             throw Components.results.NS_ERROR_NO_AGGREGATION;
  93.     
  94.         if (!iid.equals(FLOCK_PHOTO_UPLOAD_IID) &&
  95.             !iid.equals(Components.interfaces.nsISupports))
  96.             throw Components.results.NS_ERROR_INVALID_ARG;
  97.  
  98.         return new flockPhotoUpload();
  99.     }
  100. }
  101.  
  102. /* module initialisation */
  103. function NSGetModule(comMgr, fileSpec) { return flockPhotoUploadModule; }
  104.  
  105.